﻿/*********************************************************************
 版权所有: 版权所有(C) 2010 ,熙软研发部
 模块编号:  Business_YiWu_SliceManage.aspx.cs
 作    者:高文华
 编写日期:2010-02-23
 审    核:
 审核日期:
 描    述:时段信息管理页面
...........................................................................
如果模块有修改，则每次修改添加以下注释(以系统上线后为基准)：

 *********************************************************************/

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using Cisoft.YiWu.Model;
using Cisoft.YiWu.BLL;
using Cisoft.IntegrationSystem.Model;
using Cisoft.IntegrationSystem.BLL;

public partial class Business_YiWu_SliceManage : WebUI.Page.SendMessagePage
{
    AreaInfoMO modelAreaInfoshow = new AreaInfoMO();
    AreaInfoBO bllAreaInfoshow = new AreaInfoBO();

    HospitalInfoMO modelHospitalInfoshow = new HospitalInfoMO();
    HospitalInfoBO bllHospitalInfoshow = new HospitalInfoBO();

    DepartmentInfoMO modelDepartmentInfoshow = new DepartmentInfoMO();
    DepartmentInfoBO bllDepartmentInfoshow = new DepartmentInfoBO();

    protected void Page_Load(object sender, EventArgs e)
    {
        #region 管理员登录Session 判断 整合新逻辑  代码放置后请检查本页面中是否存在Login.aspx字眼等相关逻辑
        ////登陆起时判断\ Session过期     整合新逻辑                                            //后续补全
        //if (Session["UserID"] != null && Session["UserID"].ToString() != "")
        //{ }
        //else
        //{
        //    string cmsinteurl = ConfigMg.UIConfig.cisIntegrationcms.ToString();
        //    Response.Write("<script language=javascript>parent.window.parent.window.location.href='" + cmsinteurl + "'</script>");
        //}/* end of if*/
        #endregion

        #region 权限逻辑，预留扩展

        //if (Session["UserPowerArray"] != null && Session["UserPowerArray"].ToString() != "")
        //{

        //    //审核权限
        //    if (StringinArray("UYHGL_HYZLGL_Shenhe", (string[])Session["UserPowerArray"]))
        //    {
        //        ibtnshenpi.Visible = true;
        //    }
        //    else
        //    {
        //        ibtnshenpi.Visible = false;
        //    }


        //    //删除权限
        //    if (StringinArray("UYHGL_HYZLGL_Delete", (string[])Session["UserPowerArray"]))
        //    {
        //        butDelete.Visible = true;
        //    }
        //    else
        //    {
        //        butDelete.Visible = false;
        //    }

        //}
        //else
        //{
        //    //Response.Write("<script language=javascript>parent.window.parent.window.location.href='../Login.aspx'</script>");
        //}

        #endregion

        //第一次页面加载

        if (!IsPostBack)
        {
            //绑定区域
            Initializtion(this.ddl_ParentArea, 0, 0, "==全部区域==");

            //绑定固定医院
            DDLTemplate.Visible = false;
            BindDropDownList(DDLTemplate);

            //绑定医院
            BindDropDownListByAreaInfo(ddlHospital);

            //绑定科室
            BindDropDownListforDep(ddlDep);

            //绑定时段
            //BindDropDownListBookTime(ddltime);

            //txtDateA.Text = txtDateB.Text = DateTime.Now.ToString("yyyy-MM-dd");

            gvitemBind();


        }/* end of if*/


        //删除确认提示信息
        butDelete.Attributes.Add("onclick", "return confirm('您确定要删除吗？相关的附属信息也将一并删除')");
    }

    #region 区域绑定

    #region 下拉框显示树型

    /// <summary>
    /// 初始化组合框级别（无限级栏目）
    /// </summary>
    /// <param name="dropList">组合框名称</param>
    /// <param name="iDepth">深度</param>
    /// <param name="iParentID">父类ID</param>
    public void Initializtion(DropDownList dropList, int iDepth, int iParentID, string strTip)
    {
        dropList.Items.Clear();
        dropList.Items.Add(new ListItem(strTip, "0"));

        ShowColumns(dropList, iDepth, iParentID);
    }

    /// <summary>
    /// 组合框显示所有级别（无限级级别）
    /// </summary>
    /// <param name="dropList">组合框名称</param>
    /// <param name="iDepth">深度</param>
    ///  <param name="iParentID">父类ID</param>int iParentID
    public void ShowColumns(DropDownList dropList, int iDepth, int iParentID)
    {
        AreaInfoBO bllgroup = new AreaInfoBO();
        AreaInfoMO modelgroup = new AreaInfoMO();

        //定义变量
        int iCount = 0;
        int iSum = 0;
        string strGroupName = "";
        string strGroupID = "";


        DataSet myDataSet = new DataSet();

        myDataSet = bllgroup.GetList(" AI_AreaParentID =" + iParentID + "");
        iCount = myDataSet.Tables[0].Rows.Count;

        if (iCount != 0)
        {
            //iSum深度处理
            iSum = iDepth + 1;

            for (int i = 0; i < iCount; i++)
            {
                if (i == (iCount - 1))
                {
                    strGroupName = replaceWord(GetDepth("├◎" + myDataSet.Tables[0].Rows[i]["AI_AreaName"].ToString(), iSum));
                    strGroupID = myDataSet.Tables[0].Rows[i]["AI_AreaID"].ToString();

                    dropList.Items.Add(new ListItem(strGroupName, strGroupID));
                }
                else
                {
                    strGroupName = replaceWord(GetDepth("├◎" + myDataSet.Tables[0].Rows[i]["AI_AreaName"].ToString(), iSum));
                    strGroupID = myDataSet.Tables[0].Rows[i]["AI_AreaID"].ToString();

                    dropList.Items.Add(new ListItem(strGroupName, myDataSet.Tables[0].Rows[i]["AI_AreaID"].ToString()));
                }
                ShowColumns(dropList, iSum, Int32.Parse(myDataSet.Tables[0].Rows[i]["AI_AreaID"].ToString()));
            }
        }
    }

    /// <summary>
    /// 字符串插入"│"字符
    /// </summary>
    /// <param name="str">需要插入"│"的字符串</param>
    /// <param name="i">插入"│"字符串的索引位置</param>
    /// <returns></returns>
    private static string GetDepth(string strGroupName, int iCount)
    {
        for (int i = 1; i < iCount; i++)
        {
            strGroupName = strGroupName.Insert(0, "│");
        }

        return strGroupName;
    }

    /// <summary>
    /// 将指定字符串里的“&nbsp;”替换为空字符
    /// </summary>
    /// <param name="strText"></param>
    /// <returns></returns>
    private string replaceWord(string strText)
    {
        string outText = strText.Replace("&nbsp;", " ");
        return outText;
    }

    #endregion
    #endregion

    #region  绑定查询类型(绑定医院名称及ID)同步区域
    /// <summary>
    /// 绑定查询类型(绑定医院名称及ID)同步区域
    /// </summary>
    /// <param name="dl"> 下拉框控件</param>
    protected void BindDropDownListByAreaInfo(DropDownList dl)
    {
        dl.Items.Clear();

        if (ddl_ParentArea.SelectedValue.ToString() == "0")
        {

            dl.Items.Add(new ListItem("==全部医院==", "0"));
        }
        else
        {
            dl.Items.Add(new ListItem("==全部医院==", "0"));
            Cisoft.YiWu.BLL.HospitalInfoBO bllhospital = new Cisoft.YiWu.BLL.HospitalInfoBO();
            DataSet ds = bllhospital.GetList(" HI_HospitalAreaID=" + ddl_ParentArea.SelectedValue.ToString());

            if (ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    dl.Items.Add(new ListItem(ds.Tables[0].Rows[i]["HI_HospitalName"].ToString(), ds.Tables[0].Rows[i]["HI_HospitalID"].ToString()));
                }
            }
        }
    }

    #endregion

    #region  绑定查询类型(绑定医院名称及ID)
    /// <summary>
    /// 绑定查询类型(绑定医院名称及ID)
    /// </summary>
    /// <param name="dl"> 下拉框控件</param>
    protected void BindDropDownList(DropDownList dl)
    {
        dl.Items.Clear();

        Cisoft.YiWu.BLL.HospitalInfoBO bllhospital = new Cisoft.YiWu.BLL.HospitalInfoBO();
        DataSet ds = bllhospital.GetAllList();

        if (ds.Tables[0].Rows.Count > 0)
        {
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                dl.Items.Add(new ListItem(ds.Tables[0].Rows[i]["HI_HospitalName"].ToString(), ds.Tables[0].Rows[i]["HI_HospitalID"].ToString()));
            }

            #region 根据登录管理员用户判定选中指向的医院,后续预留扩展 默认为指向第一个记录

            lblHospitalID.Text = ds.Tables[0].Rows[0]["HI_HospitalID"].ToString();
            lblHospitalName.Text = ds.Tables[0].Rows[0]["HI_HospitalName"].ToString();

            #endregion

        }
        else
        {
            //无预约时段安排
            lblHospitalID.Text = "";
            lblHospitalName.Text = "暂无预约医院";
        }
    }

    #endregion

    #region  绑定查询类型(绑定科室名称及ID)同步医院
    /// <summary>
    /// 绑定查询类型(绑定科室名称及ID)同步医院
    /// </summary>
    /// <param name="dl"> 下拉框控件</param>
    protected void BindDropDownListforDep(DropDownList dldep)
    {
        dldep.Items.Clear();

        if (ddlHospital.SelectedValue.ToString() == "0")
        {

            dldep.Items.Add(new ListItem("==全部科室==", "0"));
        }
        else
        {
            dldep.Items.Add(new ListItem("==全部科室==", "0"));

            Cisoft.YiWu.BLL.DepartmentInfoBO blldep = new Cisoft.YiWu.BLL.DepartmentInfoBO();
            DataSet ds = blldep.GetList(" DI_DepartmentHospitalID=" + ddlHospital.SelectedValue.ToString());

            if (ds.Tables[0].Rows.Count > 0)
            {

                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    dldep.Items.Add(new ListItem(ds.Tables[0].Rows[i]["DI_DepartmentlName"].ToString(), ds.Tables[0].Rows[i]["DI_DepartmentID"].ToString()));
                }
            }
        }
    }
    #endregion

    #region  绑定预约时间段
    /// <summary>
    /// 绑定预约时间段
    /// </summary>
    /// <param name="dl"> 下拉框控件</param>
    //protected void BindDropDownListBookTime(DropDownList dltime)
    //{
    //    dltime.Items.Clear();

    //    Cisoft.YiWu.BLL.TimeSliceBO blltimeslice = new Cisoft.YiWu.BLL.TimeSliceBO();

    //    if (ddlDep.SelectedValue.ToString() != "" && ddlDep.SelectedValue.ToString() != "0")
    //    {

    //        DataSet ds = blltimeslice.GetListByDepartmentid(int.Parse(ddlDep.SelectedValue.ToString()));

    //        if (ds.Tables[0].Rows.Count > 0)
    //        {
    //            dltime.Items.Add(new ListItem("==全部时段==", "0"));
    //            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
    //            {
    //                dltime.Items.Add(new ListItem(ds.Tables[0].Rows[i]["TS_SliceName"].ToString(), ds.Tables[0].Rows[i]["TS_SliceID"].ToString()));
    //            }
    //        }
    //        else
    //        {
    //            //无预约时段
    //            dltime.Items.Add(new ListItem("暂无预约时段", ""));
    //        }
    //    }
    //    else
    //    {
    //        //无预约时段

    //        if (ddlDep.SelectedValue.ToString() == "0")
    //        {
    //            dltime.Items.Add(new ListItem("==全部时段==", "0"));
    //        }
    //        else
    //        {
    //            dltime.Items.Add(new ListItem("暂无预约时段", ""));
    //        }


    //    }
    //}
    #endregion

    #region 全选事件
    /// <summary>
    /// 全选按钮事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void All_check(object sender, EventArgs e)
    {
        rebackLookout();//清空查询框，后续补全
        for (int i = 0; i < gvitem.Rows.Count; i++)
        {
            ((CheckBox)gvitem.Rows[i].FindControl("chkSelect")).Checked = this.ChkAll.Checked;
        }
    }
    #endregion

    #region 删除
    /// <summary>
    /// 删除
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void butDelete_Click(object sender, ImageClickEventArgs e)
    {
        Cisoft.YiWu.BLL.TimeSliceBO bllSlicedel = new Cisoft.YiWu.BLL.TimeSliceBO();
        Cisoft.YiWu.BLL.PlanInfoBO bllPlanInfodel = new Cisoft.YiWu.BLL.PlanInfoBO();

        rebackLookout();//清空查询框
        bool Mgtest = false;//判断是否有选择
        for (int i = 0; i < this.gvitem.Rows.Count; i++)
        {
            bool isChecked = ((CheckBox)gvitem.Rows[i].FindControl("chkSelect")).Checked;
            if (isChecked)//判断是否选择
            {
                Mgtest = true;
                int intID = Convert.ToInt32(((Label)gvitem.Rows[i].FindControl("LblID")).Text);
                try
                {
                    //删除相关业务逻辑，后续补全，预留参考
                    //DeleteFile(intID);
                    //DeleteMPR(intID);
                    //DeleteTag(intID);

                    //删除逻辑
                    //删除相关时段记录
                    bllPlanInfodel.Delete(" PI_PlanSliceID=" + intID);
                    //删除本身记录
                    bllSlicedel.Delete(intID);


                }
                catch (Exception ex)
                {
                    string errortip = "记录ID：" + intID.ToString() + "删除出现异常，请通知管理员，以下为出错提示信息：" + ex.Message.ToString();
                    PageError(errortip, "SliceManage.aspx", "返回操作", "");

                }/* end of try()*/

            }/* end of if()*/

        }/* end of for()*/

        //没有选择项时的提示
        if (!Mgtest)
        {
            //重新绑定显示
            gvitemBind();
            ChkAll.Checked = false;
            PageError("请选择要删除的记录！", "SliceManage.aspx", "返回操作", "");

        }/* end of if()*/
        else
        {
            //重新绑定显示
            gvitemBind();
            ChkAll.Checked = false;
            PageRight("恭喜，删除操作成功", "SliceManage.aspx", "返回继续操作", "");
        }

    }

    #region 删除相关逻辑预留

    #region 删除议题与会议的联系
    ///// <summary>
    ///// 删除议题与会议的联系记录信息
    ///// </summary>
    ///// <param name="Proposalid">议题编号</param>
    //private void DeleteMPR(int Proposalid)
    //{
    //    Cisoft.MeetingWeb.SqlServerDal.MPR MPRBll = new Cisoft.MeetingWeb.SqlServerDal.MPR();
    //    DataSet ds = new DataSet();
    //    ds = MPRBll.GetList(" ProposalID=" + Proposalid + "");
    //    if (ds != null)
    //    {
    //        if (ds.Tables[0].Rows.Count > 0)
    //        {
    //            int MPRid = Convert.ToInt32(ds.Tables[0].Rows[0]["MPRID"].ToString());
    //            try
    //            {
    //                MPRBll.Delete(MPRid);
    //            }
    //            catch { }
    //        }
    //    }/* end of if(ds!==null)*/

    //}
    #endregion

    #region 删除议题附文件、标签正文
    ///// <summary>
    ///// 删除议题附文件、标签正文
    ///// </summary>
    ///// <param name="Proposalid">议题编号</param>
    //protected void DeleteFile(int Proposalid)
    //{
    //    Cisoft.MeetingWeb.Bll.OAFile blloafile = new Cisoft.MeetingWeb.Bll.OAFile();
    //    Cisoft.MeetingWeb.Model.OAFile modeloafile = new Cisoft.MeetingWeb.Model.OAFile();
    //    int id = Propsalbll.GetModel(Proposalid).TagID;

    //    Cisoft.MeetingWeb.Bll.File FileBll = new Cisoft.MeetingWeb.Bll.File();

    //    modeloafile = blloafile.GetModel(id);
    //    if (modeloafile != null)
    //    {

    //        //删除所有议题下的附件文件
    //        string strfile = modeloafile.OAFileurl.ToString();
    //        string[] strFile = strfile.Split(',');
    //        for (int i = 0; i < strFile.Length - 1; i++)
    //        {
    //            string fileurl = strFile[i].ToString();
    //            try
    //            {
    //                string FileUrl = Server.MapPath(fileurl);
    //                if (File.Exists(FileUrl))
    //                {
    //                    File.Delete(FileUrl);
    //                }

    //            }/*end of try(..)*/
    //            catch { }
    //        }/* end of for(..)*/

    //        //删除议题标签正文
    //        string _ContentFileID = modeloafile.OAContentFileurl.ToString();
    //        try
    //        {
    //            string FileUrl = Server.MapPath(_ContentFileID);
    //            if (File.Exists(FileUrl))
    //            {
    //                File.Delete(FileUrl);
    //            }

    //        }/* end of try(..)*/
    //        catch { }
    //    }

    //    ////更新本地标签状态
    //    //string OAid = Propsalmodel.OAID;
    //    //if (int.Parse(OAid) > 10000)
    //    //{
    //    //    if (OAid.IndexOf("10000") != -1)
    //    //    {
    //    //        string strOAid = OAid.Replace("10000", "");
    //    //        Cisoft.MeetingWeb.Bll.OAFile _OAFile = new Cisoft.MeetingWeb.Bll.OAFile();
    //    //        _OAFile.UpdateStatus(int.Parse(strOAid), 0);
    //    //    }
    //    //}
    //}

    #endregion

    #region 删除标签记录
    //public void DeleteTag(int id)
    //{
    //    Cisoft.MeetingWeb.Bll.OAFile blloafile = new Cisoft.MeetingWeb.Bll.OAFile();
    //    Propsalmodel = Propsalbll.GetModel(id);
    //    if (Propsalmodel != null)
    //    {
    //        blloafile.Delete(Propsalmodel.TagID);
    //    }

    //}

    #endregion

    #endregion

    #endregion

    #region 显示列表
    /// <summary>
    /// 显示列表
    /// </summary>
    private void gvitemBind()
    {
        DataSet ds = new DataSet();

        //查询逻辑
        //有医院记录查询
        //判断开始时间是否大于结束时间

        Cisoft.YiWu.BLL.TimeSliceBO bllshow = new Cisoft.YiWu.BLL.TimeSliceBO();

        //if (!string.IsNullOrEmpty(txtDateA.Text) && !string.IsNullOrEmpty(txtDateB.Text))
        //{
        //    DateTime dtforend = Convert.ToDateTime(txtDateB.Text + " " + "23:59:59");
        //    DateTime dtforstart = Convert.ToDateTime(txtDateA.Text + " " + "00:00:00");

        //    if (dtforend <= dtforstart)
        //    {
        //        lbldate.Text = "<span style='font-weight:bold; color:red;'>结束时间必须大于等于开始时间！</span>";
        //        return;
        //    }
        //}
        //string startTime = string.IsNullOrEmpty(txtDateA.Text) ? "" : txtDateA.Text + " " + "00:00:00";
        //string endTime = string.IsNullOrEmpty(txtDateB.Text) ? "" : txtDateB.Text + " " + "23:59:59";
        string txtField = string.IsNullOrEmpty(txtPropasal.Text.Trim().ToString().Replace("'", "")) ? "" : txtPropasal.Text.Trim().ToString().Replace("'", "");
        //string txtFieldname = string.IsNullOrEmpty(txtPropasalname.Text.Trim().ToString().Replace("'", "")) ? "" : txtPropasalname.Text.Trim().ToString().Replace("'", "");

        ds = bllshow.GetListFourInfo(ddl_ParentArea.SelectedValue.ToString(), ddlHospital.SelectedValue.ToString(), ddlDep.SelectedValue.ToString(), txtField);

        //ibtnExport.Attributes.Add("onclick", "window.open('../../CreateExcel/CreatePlanInfoExcel.aspx?startTime=" + startTime + "&endTime=" + endTime + "&txtFieldname=" + txtFieldname + "&txtField=" + txtField + "&lblHospitalID=" + lblHospitalID.Text.ToString() + "&ddlDep=" + ddlDep.SelectedValue.ToString() + "&ddltime=" + ddltime.SelectedValue.ToString() + " ','导出Excel','width=0;height=0,resizable=no,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,left=5000,top=5000')");

        DataView dvforalldata = new DataView();
        ViewState["numbers"] = ds.Tables[0].Rows.Count.ToString();
        dvforalldata.Table = ds.Tables[0];
        //dvforalldata.Sort = "EI_Order desc";

        gvitem.DataSource = dvforalldata;

        gvitem.DataBind();
        butState();   //显示分页按钮状态
        ShowStats(); //显示页数

        //分页跳转
        ShowStats(ds.Tables[0].Rows.Count);
    }

    #endregion

    #region 翻页事件
    /// <summary>
    /// 翻页事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void PagerButtonClick(object sender, EventArgs e)
    {
        string arg = ((LinkButton)sender).CommandArgument.ToString();
        switch (arg)
        {
            case "next":
                if (gvitem.PageIndex < (gvitem.PageCount - 1))
                {
                    gvitem.PageIndex += 1;
                }
                break;
            case "prev":
                if (gvitem.PageIndex > 0)
                {
                    gvitem.PageIndex -= 1;
                }
                break;
            case "last":
                gvitem.PageIndex = (gvitem.PageCount - 1);
                break;
            default:
                gvitem.PageIndex = System.Convert.ToInt32(arg);
                break;
        }/* end of  switch (arg) */
        gvitemBind();

    }
    #endregion

    #region 翻页按钮状态
    /// <summary>
    /// 翻页按钮状态
    /// </summary>
    private void butState()
    {
        if (this.gvitem.PageIndex < 1)
        {
            this.btnFirst.Enabled = false;
            this.btnPrev.Enabled = false;
        }
        else
        {
            this.btnFirst.Enabled = true;
            this.btnPrev.Enabled = true;
        }

        if ((this.gvitem.PageIndex + 2) > this.gvitem.PageCount)
        {
            this.btnLast.Enabled = false;
            this.btnNext.Enabled = false;
        }
        else
        {
            this.btnLast.Enabled = true;
            this.btnNext.Enabled = true;
        }
    }
    #endregion

    #region 显示页数
    /// <summary>
    /// 显示页数
    /// </summary>
    private void ShowStats()
    {
        lblCurrentIndex.Text = "第 <font color='red'>" + (this.gvitem.PageIndex + 1).ToString() + "</font> 页";
        string Pagecount = "";
        int i = int.Parse(this.gvitem.PageCount.ToString());
        if (i == 0)
        {
            Pagecount = "1";
        }
        else
        {
            Pagecount = this.gvitem.PageCount.ToString();
        }
        lblNumbers.Text = "总共 " + ViewState["numbers"].ToString() + " 记录";
        lblPageCount.Text = "共 <font color='red'>" + Pagecount + "</font> 页";
    }
    #endregion

    #region gridview中的事件

    #region RowDataBound事件
    /// <summary>
    /// RowDataBound事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void gvitem_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            //会员ID绑定
            Label LblID = (Label)e.Row.FindControl("LblID");



            //显示企业名称
            //Label LblRealname = (Label)e.Row.FindControl("LblRealname");

            //LblRealname.Text = DataBinder.Eval(e.Row.DataItem, "EI_Name").ToString();

            //区域名称
            //Label lblAI_AreaName = (Label)e.Row.FindControl("lblAI_AreaName");
            //modelAreaInfoshow = bllAreaInfoshow.GetModel(int.Parse(DataBinder.Eval(e.Row.DataItem, "HI_HospitalAreaID").ToString()));
            //if (modelAreaInfoshow != null)
            //{
            //    lblAI_AreaName.Text = modelAreaInfoshow.AI_AreaName;
            //}


            //显示真实姓名
            //Label LblMemberGroupName = (Label)e.Row.FindControl("LblMemberGroupName");

            //modelmembergroupforlist = bllmembergroupforlist.GetModel(int.Parse(DataBinder.Eval(e.Row.DataItem, "MB_GroupID_Rid").ToString()));

            //LblMemberGroupName.Text = modelmembergroupforlist.MemberGroupName;

            //名企推荐
            //Label LblGood = (Label)e.Row.FindControl("LblGood");
            //int nGood = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "EI_Good").ToString());

            //if (nGood == 1)
            //{
            //    LblGood.Text = "是";
            //}
            //else
            //{
            //    LblGood.Text = "否";
            //}

            #region 新企业会员审核逻辑

            ////账号状态，0未审核 ，1 审核通过 ，2 审核不通过
            //Label LblStatus = (Label)e.Row.FindControl("LblStatus");
            //int intStatus = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "MB_RegisterState").ToString());
            //switch (intStatus)
            //{
            //    case 0:
            //        {
            //            LblStatus.Text = "未审核";
            //            break;
            //        }
            //    case 1:
            //        {

            //            if (Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "MB_GroupID_Rid").ToString()) == int.Parse(ConfigMg.UIConfig.cisRegisterMemberEnterpriseGroupID.ToString()))
            //            {
            //                LblStatus.Text = "未审核";
            //            }
            //            else
            //            {
            //                LblStatus.Text = "<font color='SeaGreen'>审核通过</font>";
            //            }
            //            break;
            //        }
            //    case 2:
            //        {
            //            LblStatus.Text = "<font color='red'>审核不通过</font>";
            //            break;
            //        }
            //    default:
            //        {
            //            LblStatus.Text = "未知状态";
            //            break;
            //        }
            //}/* end of switch()*/

            #endregion

            #region 旧企业会员审核逻辑
            ////账号状态，0未审核 ，1 审核通过 ，2 审核不通过
            //Label LblStatus = (Label)e.Row.FindControl("LblStatus");
            //int intStatus = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "MB_RegisterState").ToString());
            //switch (intStatus)
            //{
            //    case 0:
            //        {
            //            LblStatus.Text = "未审核";
            //            break;
            //        }
            //    case 1:
            //        {
            //            LblStatus.Text = "<font color='SeaGreen'>审核通过</font>";
            //            break;
            //        }
            //    case 2:
            //        {
            //            LblStatus.Text = "<font color='red'>审核不通过</font>";
            //            break;
            //        }
            //    default:
            //        {
            //            LblStatus.Text = "未知状态";
            //            break;
            //        }
            //}/* end of switch()*/
            #endregion


        }/* end of if (e.Row.RowType == DataControlRowType.DataRow)*/

        //鼠标在列表行中停留时的样式
        for (int i = -1; i < gvitem.Rows.Count; i++)
        {
            //首先判断是否是数据行
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                //当鼠标停留时更改背景色
                e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#B5C9DD'");
                //当鼠标移开时还原背景色
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
            }
        }/* end of  for (int i = -1; i < gvitem.Rows.Count; i++) */
    }
    #endregion

    #region  RowCommand事件
    /// <summary>
    /// RowCommand事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void gvitem_RowCommand(object sender, GridViewCommandEventArgs e)
    {

    }
    #endregion

    #region RowCreated事件
    /// <summary>
    /// RowCreated事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void gvitem_RowCreated(object sender, GridViewRowEventArgs e)
    {

    }
    #endregion

    #region PageIndexChanging事件
    /// <summary>
    /// PageIndexChanging事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void gvitem_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        gvitem.PageIndex = e.NewPageIndex;
    }
    #endregion

    #endregion

    #region  查询事件
    /// <summary>
    /// 查询事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void butlookout_Click(object sender, ImageClickEventArgs e)
    {
        if (IsValid)
        {
            gvitemBind();
        }
    }
    #endregion

    #region 清空查询后的状态
    /// <summary>
    /// 清空查询后的状态
    /// </summary>
    private void rebackLookout()
    {
        txtPropasal.Text = "";
        //txtPropasalname.Text = "";
    }
    #endregion

    #region 根据数字ID返回医院名字
    public string GetHospitalName(string id)
    {
        string hospitalname = "暂无预约医院";

        Cisoft.YiWu.BLL.HospitalInfoBO bllHospital = new Cisoft.YiWu.BLL.HospitalInfoBO();
        Cisoft.YiWu.Model.HospitalInfoMO modelHospital = new Cisoft.YiWu.Model.HospitalInfoMO();

        modelHospital = bllHospital.GetModel(int.Parse(id));

        if (modelHospital != null)
        {
            hospitalname = modelHospital.HI_HospitalName;
        }

        return hospitalname;
    }
    #endregion

    #region  查询选项改变事件
    /// <summary>
    /// 
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void DDLTemplate_SelectedIndexChanged(object sender, EventArgs e)
    {
        lblHospitalID.Text = DDLTemplate.SelectedValue.ToString();
        lblHospitalName.Text = GetHospitalName(DDLTemplate.SelectedValue.ToString());

        //绑定科室
        //BindDropDownListforDep(ddlDep);

        //绑定时段
        //BindDropDownListBookTime(ddltime);

        gvitemBind();
    }
    #endregion

    #region 清空查询内容 protected void ibtClear_Click(object sender, ImageClickEventArgs e)
    /// <summary>
    /// 清空查询内容
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void ibtClear_Click(object sender, ImageClickEventArgs e)
    {
        rebackLookout();
    }
    #endregion

    #region 发送短信提醒
    /// <summary>
    /// 发送短信提醒
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    //protected void ibtntuijian_Click(object sender, ImageClickEventArgs e)
    //{

    //    Cisoft.YiWu.BLL.PlanInfoBO bllplaninfotouser = new Cisoft.YiWu.BLL.PlanInfoBO();
    //    Cisoft.YiWu.Model.PlanInfoMO modelplaninfotouser = new Cisoft.YiWu.Model.PlanInfoMO();

    //    string strContent = "";

    //    rebackLookout();//清空查询框
    //    bool Mgtest = false;//判断是否有选择
    //    for (int i = 0; i < this.gvitem.Rows.Count; i++)
    //    {
    //        bool isChecked = ((CheckBox)gvitem.Rows[i].FindControl("chkSelect")).Checked;
    //        if (isChecked)//判断是否选择
    //        {
    //            Mgtest = true;
    //            int intID = Convert.ToInt32(((Label)gvitem.Rows[i].FindControl("LblID")).Text);
    //            try
    //            {
    //                //删除相关业务逻辑，后续补全，预留参考
    //                //DeleteFile(intID);
    //                //DeleteMPR(intID);
    //                //DeleteTag(intID);

    //                //根据列表主键（企业会员信息主键）获取账户表主键再进行审核

    //                modelplaninfotouser = bllplaninfotouser.GetModel(intID);
    //                if (modelplaninfotouser != null)
    //                {
    //                    if (modelplaninfotouser.PI_MobileNum.ToString().Length == 11 && strSourceNumtest(modelplaninfotouser.PI_MobileNum.ToString()))
    //                    {
    //                        DataSet dstemp = bllplaninfotouser.GetModelAllInfo(intID);

    //                        if (dstemp != null)
    //                        {
    //                            //发送短信
    //                            strContent = "您预约" + dstemp.Tables[0].Rows[0]["HI_HospitalName"].ToString() + "的" + dstemp.Tables[0].Rows[0]["DI_DepartmentlName"].ToString() + "。时间为：" + Cisoft.IntegrationSystem.Common.DateTimeHelper.GetChinaShortDateAndWeeky(System.Convert.ToDateTime(dstemp.Tables[0].Rows[0]["PI_PlanTime"].ToString())) + dstemp.Tables[0].Rows[0]["TS_SliceName"].ToString() + "请提前15分钟来院就诊";
    //                            SendMessage(modelplaninfotouser.PI_MobileNum, strContent);
    //                        }
    //                    }
    //                }
    //            }
    //            catch (Exception ex)
    //            {
    //                string errortip = "记录ID：" + intID.ToString() + "发送提醒短信出现异常，请通知管理员，以下为出错提示信息：" + ex.Message.ToString();
    //                PageError(errortip, "PlanManage.aspx", "返回操作", "");
    //                //Cisoft.MeetingWeb.Common.Function.alert("删除失败！", this.Page);
    //            }/* end of try()*/

    //        }/* end of if()*/

    //    }/* end of for()*/

    //    //没有选择项时的提示
    //    if (!Mgtest)
    //    {
    //        //重新绑定显示
    //        gvitemBind();
    //        ChkAll.Checked = false;
    //        PageError("请选择要发送提醒的记录！", "PlanManage.aspx", "返回操作", "");
    //        //Cisoft.MeetingWeb.Common.Function.alert("请选择要删除的议题！", this.Page);
    //    }/* end of if()*/
    //    else
    //    {
    //        //重新绑定显示
    //        gvitemBind();
    //        ChkAll.Checked = false;
    //        PageRight("恭喜，发送提醒操作成功", "PlanManage.aspx", "返回继续操作", "");
    //    }
    //}
    #endregion

    #region 新增
    protected void ibtnxinzeng_Click(object sender, ImageClickEventArgs e)
    {
        Response.Redirect("SliceAdd.aspx");

        //测试逻辑
        //Response.Redirect("PlanAdd.aspx?hospitalid=1");
    }
    #endregion

    #region 私有方法 分页
    /// <summary>
    /// 多页数处理
    /// </summary>
    protected void PagerButtonClick(object sender, ImageClickEventArgs e)
    {
        string arg = ((ImageButton)sender).CommandArgument.ToString();
        switch (arg)
        {
            case "next":
                if (gvitem.PageIndex < (gvitem.PageCount - 1)) gvitem.PageIndex += 1;
                break;
            case "prev":
                if (gvitem.PageIndex > 0) gvitem.PageIndex -= 1;
                break;
            default:
                gvitem.PageIndex = Convert.ToInt32(arg);
                break;
        }
        gvitemBind();
    }
    protected void btnPageGo_Click(object sender, EventArgs e)
    {
        if (!isnumber(txtPageGo.Text.Trim()))
        {
            MessageBox(this.Page, "请输入数字类型！");
            return;
        }
        if (Convert.ToInt32(txtPageGo.Text) > 0 && Convert.ToInt32(txtPageGo.Text) <= gvitem.PageCount)
        {
            gvitem.PageIndex = Convert.ToInt32(txtPageGo.Text) - 1;
        }
        else if (Convert.ToInt32(txtPageGo.Text) <= 0)
        {
            gvitem.PageIndex = 0;
        }
        else if (Convert.ToInt32(txtPageGo.Text) > gvitem.PageCount)
        {
            gvitem.PageIndex = gvitem.PageCount - 1;
        }
        txtPageGo.Text = "";

        gvitemBind();
    }

    /// <summary>
    /// 多页处理方法
    /// </summary>
    /// <param name="totalCount">页数</param>
    private void ShowStats(int totalCount)
    {
        if (gvitem.Rows.Count > 0)//当有记录的时候
        {
            PageDiv.Visible = true; //显示分页
            lbCurrentIndex.Text = (gvitem.PageIndex + 1).ToString();//当前页
            lbPageCount.Text = gvitem.PageCount.ToString();//总页数
            lbSum.Text = totalCount.ToString();//总记录数
            if (gvitem.PageCount == 1)//当总页数为1时
            {
                ibtnPreviousPage.Enabled = false;
                ibtnNextPage.Enabled = false;
            }
            else //当总也数大于1时
            {
                if (gvitem.PageIndex == (gvitem.PageCount - 1))//当 当前页为最后一页时
                {
                    ibtnPreviousPage.Enabled = true;
                    ibtnNextPage.Enabled = false;
                }
                else if (gvitem.PageIndex == 0) //当 当前页为第一页时
                {
                    ibtnPreviousPage.Enabled = false;
                    ibtnNextPage.Enabled = true;
                }
                else
                {
                    ibtnPreviousPage.Enabled = true;
                    ibtnNextPage.Enabled = true;
                }
            }
        }
        else //当无记录的时候
        {
            PageDiv.Visible = false;
        }
    }
    #endregion

    #region javascript脚本输出：弹出消息
    /// <summary>
    /// javascript脚本输出：弹出消息
    /// </summary>
    /// <param name="page"></param>
    /// <param name="message"></param>
    public void MessageBox(Page page, string message)
    {
        string sScript = "<script language='javascript'>";
        sScript += "alert('" + message + "');";
        sScript += "</script>";
        page.RegisterStartupScript("alert", sScript);
    }
    #endregion

    #region 全为数字
    public bool isnumber(string s)
    {
        int Flag = 0;
        char[] str = s.ToCharArray();
        for (int i = 0; i < str.Length; i++)
        {
            if (Char.IsNumber(str[i]))
            {
                Flag++;
            }
            else
            {
                Flag = -1;
                break;
            }
        }
        if (Flag > 0)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
    #endregion

    #region 扩展功能1预留
    protected void ibtnputong_Click(object sender, ImageClickEventArgs e)
    {
        //Cisoft.IntegrationSystem.BLL.EnterpriseInfoBO bllentergood = new Cisoft.IntegrationSystem.BLL.EnterpriseInfoBO();

        //rebackLookout();//清空查询框
        //bool Mgtest = false;//判断是否有选择
        //for (int i = 0; i < this.gvitem.Rows.Count; i++)
        //{
        //    bool isChecked = ((CheckBox)gvitem.Rows[i].FindControl("chkSelect")).Checked;
        //    if (isChecked)//判断是否选择
        //    {
        //        Mgtest = true;
        //        int intID = Convert.ToInt32(((Label)gvitem.Rows[i].FindControl("LblID")).Text);
        //        try
        //        {
        //            //删除相关业务逻辑，后续补全，预留参考
        //            //DeleteFile(intID);
        //            //DeleteMPR(intID);
        //            //DeleteTag(intID);

        //            //根据列表主键（企业会员信息主键）获取账户表主键再进行审核



        //            bllentergood.UpdateGoodNum(0, intID);




        //            //Propsalbll.Delete(intID);
        //            //Cisoft.MeetingWeb.Common.Function.alert("删除成功！", this.Page);
        //        }
        //        catch (Exception ex)
        //        {
        //            string errortip = "帐号ID：" + intID.ToString() + "设置为普通出现异常，请通知管理员，以下为出错提示信息：" + ex.Message.ToString();
        //            PageError(errortip, "EnterpriseManagement.aspx", "返回操作", "");
        //            //Cisoft.MeetingWeb.Common.Function.alert("删除失败！", this.Page);
        //        }/* end of try()*/

        //    }/* end of if()*/

        //}/* end of for()*/

        ////没有选择项时的提示
        //if (!Mgtest)
        //{
        //    //重新绑定显示
        //    gvitemBind();
        //    ChkAll.Checked = false;
        //    PageError("请选择要设置为普通的记录！", "EnterpriseManagement.aspx", "返回操作", "");
        //    //Cisoft.MeetingWeb.Common.Function.alert("请选择要删除的议题！", this.Page);
        //}/* end of if()*/
        //else
        //{
        //    //重新绑定显示
        //    gvitemBind();
        //    ChkAll.Checked = false;
        //    PageRight("恭喜，设置为普通操作成功", "EnterpriseManagement.aspx", "返回继续操作", "");
        //}
    }
    #endregion

    #region 扩展功能2预留
    /// <summary>
    /// 扩展功能2预留
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void ibtnshenpi_Click(object sender, ImageClickEventArgs e)
    {
        ////修改审核企业逻辑
        //Cisoft.IntegrationSystem.Model.MemberGroupMO modelMemberGroup = new Cisoft.IntegrationSystem.Model.MemberGroupMO();
        //Cisoft.IntegrationSystem.BLL.MemberGroupBO bllMemberGroup = new Cisoft.IntegrationSystem.BLL.MemberGroupBO();
        //modelMemberGroup = bllMemberGroup.GetModel(int.Parse(ConfigMg.UIConfig.cisShenHeMemberEnterpriseGroupID.ToString()));
        //int ntoRoleid = 0;
        //if (modelMemberGroup != null)
        //{
        //    ntoRoleid = modelMemberGroup.MemberGroupRole;
        //}


        //rebackLookout();//清空查询框
        //bool Mgtest = false;//判断是否有选择
        //for (int i = 0; i < this.gvitem.Rows.Count; i++)
        //{
        //    bool isChecked = ((CheckBox)gvitem.Rows[i].FindControl("chkSelect")).Checked;
        //    if (isChecked)//判断是否选择
        //    {
        //        Mgtest = true;
        //        int intID = Convert.ToInt32(((Label)gvitem.Rows[i].FindControl("LblID")).Text);
        //        try
        //        {
        //            //删除相关业务逻辑，后续补全，预留参考
        //            //DeleteFile(intID);
        //            //DeleteMPR(intID);
        //            //DeleteTag(intID);

        //            //根据列表主键（企业会员信息主键）获取账户表主键再进行审核


        //            int mid = bllmemberEnterforlist.GetListMemberID(intID);

        //            if (mid > 0)
        //            {

        //                //修改审核企业逻辑
        //                bllmemberforlist.EditGroupIDAndRoleID(mid, int.Parse(ConfigMg.UIConfig.cisShenHeMemberEnterpriseGroupID.ToString()), ntoRoleid);


        //                bllmemberforlist.EditRegisterState(mid, 1);
        //                Cisoft.IntegrationSystem.BLL.AccountPointInfoBO bllaccountPointshow = new Cisoft.IntegrationSystem.BLL.AccountPointInfoBO();
        //                //Cisoft.IntegrationSystem.BLL.AccountInformationBO bllAccountInformation = new Cisoft.IntegrationSystem.BLL.AccountInformationBO();
        //                Cisoft.IntegrationSystem.Model.AccountInformationMO modelAccountInformation = new Cisoft.IntegrationSystem.Model.AccountInformationMO();
        //                modelAccountInformation = bllaccountPointshow.GetAccountInformationByMemberID(mid);

        //                Cisoft.IntegrationSystem.BLL.AccountPointInfoBO bllactountPointInfo = new Cisoft.IntegrationSystem.BLL.AccountPointInfoBO();
        //                Cisoft.IntegrationSystem.Model.AccountPointInfoMO modelactountPointInfo = new Cisoft.IntegrationSystem.Model.AccountPointInfoMO();
        //                modelactountPointInfo.MB_MemberID = mid;
        //                modelactountPointInfo.API_Total += Convert.ToDecimal(modelAccountInformation.AcIn_AccountPoint);
        //                modelactountPointInfo.API_StartDate = DateTime.Now;
        //                modelactountPointInfo.API_EndDate = new DateTime(modelactountPointInfo.API_StartDate.Year, modelactountPointInfo.API_StartDate.Month + 1, modelactountPointInfo.API_StartDate.Day, modelactountPointInfo.API_StartDate.Hour, modelactountPointInfo.API_StartDate.Minute, modelactountPointInfo.API_StartDate.Second);
        //                bllactountPointInfo.Add(modelactountPointInfo);

        //                Cisoft.IntegrationSystem.BLL.PointRecordBO bllPointRecordInfo = new Cisoft.IntegrationSystem.BLL.PointRecordBO();
        //                Cisoft.IntegrationSystem.Model.PointRecordMO modelPointRecordInfo = new Cisoft.IntegrationSystem.Model.PointRecordMO();
        //                modelPointRecordInfo.PR_Point = Convert.ToDecimal(modelAccountInformation.AcIn_AccountPoint);
        //                modelPointRecordInfo.PR_RecordName = "初始化服务点数";
        //                modelPointRecordInfo.PR_Date = DateTime.Now;
        //                modelPointRecordInfo.API_ID = modelactountPointInfo.API_ID;
        //                bllPointRecordInfo.Add(modelPointRecordInfo);
        //            }





        //            //Propsalbll.Delete(intID);
        //            //Cisoft.MeetingWeb.Common.Function.alert("删除成功！", this.Page);
        //        }
        //        catch (Exception ex)
        //        {
        //            string errortip = "帐号ID：" + intID.ToString() + "审核出现异常，请通知管理员，以下为出错提示信息：" + ex.Message.ToString();
        //            PageError(errortip, "EnterpriseManagement.aspx", "返回操作", "");
        //            //Cisoft.MeetingWeb.Common.Function.alert("删除失败！", this.Page);
        //        }/* end of try()*/

        //    }/* end of if()*/

        //}/* end of for()*/

        ////没有选择项时的提示
        //if (!Mgtest)
        //{
        //    //重新绑定显示
        //    gvitemBind();
        //    ChkAll.Checked = false;
        //    PageError("请选择要审核的记录！", "EnterpriseManagement.aspx", "返回操作", "");
        //    //Cisoft.MeetingWeb.Common.Function.alert("请选择要删除的议题！", this.Page);
        //}/* end of if()*/
        //else
        //{
        //    //重新绑定显示
        //    gvitemBind();
        //    ChkAll.Checked = false;
        //    PageRight("恭喜，审核操作成功", "EnterpriseManagement.aspx", "返回继续操作", "");
        //}

        //////重新绑定显示
        ////gvitemBind();
        ////ChkAll.Checked = false;
    }
    #endregion

    #region 扩展功能3预留
    protected void ibtnchongzhi_Click(object sender, ImageClickEventArgs e)
    {
        //Cisoft.IntegrationSystem.BLL.MemberBO bllmemberforczmm = new Cisoft.IntegrationSystem.BLL.MemberBO();
        //Cisoft.IntegrationSystem.Model.MemberMO modelforczmm = new Cisoft.IntegrationSystem.Model.MemberMO();
        //Cisoft.IntegrationSystem.Common.MD5 md5 = new Cisoft.IntegrationSystem.Common.MD5();
        //string strpwd = "888888";
        //strpwd = ConfigMg.UIConfig.cisforgetpwd.ToString();
        //strpwd = md5.HashString(strpwd);

        //rebackLookout();//清空查询框
        //bool Mgtest = false;//判断是否有选择
        //for (int i = 0; i < this.gvitem.Rows.Count; i++)
        //{
        //    bool isChecked = ((CheckBox)gvitem.Rows[i].FindControl("chkSelect")).Checked;
        //    if (isChecked)//判断是否选择
        //    {
        //        Mgtest = true;
        //        int intID = Convert.ToInt32(((Label)gvitem.Rows[i].FindControl("LblID")).Text);
        //        try
        //        {
        //            int mid = bllmemberEnterforlist.GetListMemberID(intID);

        //            if (mid > 0)
        //            {
        //                modelforczmm = bllmemberforczmm.GetModel(mid);
        //                //md5加密处理
        //                modelforczmm.MemberPassword = strpwd;
        //                bllmemberforczmm.EditRecord(modelforczmm);
        //            }
        //        }
        //        catch (Exception ex)
        //        {
        //            string errortip = "帐号ID：" + intID.ToString() + "重置密码出现异常，请通知管理员，以下为出错提示信息：" + ex.Message.ToString();
        //            PageError(errortip, "EnterpriseManagement.aspx", "返回操作", "");
        //            //Cisoft.MeetingWeb.Common.Function.alert("删除失败！", this.Page);
        //        }/* end of try()*/

        //    }/* end of if()*/

        //}/* end of for()*/

        ////没有选择项时的提示
        //if (!Mgtest)
        //{
        //    //重新绑定显示
        //    gvitemBind();
        //    ChkAll.Checked = false;
        //    PageError("请选择要重置密码的记录！", "EnterpriseManagement.aspx", "返回操作", "");
        //    //Cisoft.MeetingWeb.Common.Function.alert("请选择要删除的议题！", this.Page);
        //}/* end of if()*/
        //else
        //{
        //    //重新绑定显示
        //    gvitemBind();
        //    ChkAll.Checked = false;
        //    PageRight("恭喜，重置密码操作成功", "EnterpriseManagement.aspx", "返回继续操作", "");
        //}
    }
    #endregion

    #region 科室切换事件
    /// <summary>
    /// 科室切换事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void ddlDep_SelectedIndexChanged(object sender, EventArgs e)
    {
        gvitemBind();
    }
    #endregion

    #region 预约时段切换事件
    /// <summary>
    /// 预约时段切换事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    //protected void ddltime_SelectedIndexChanged(object sender, EventArgs e)
    //{
    //    gvitemBind();
    //}
    #endregion

    #region  验证手机号码
    /// <summary>
    /// 验证手机号码
    /// </summary>
    /// <param name="t"></param>
    /// <returns></returns>
    public bool strSourceNumtest(string t)
    {

        bool re = false;
        if (t.Length == 11 && (t.Substring(0, 3) == "133" || t.Substring(0, 3) == "153" || t.Substring(0, 3) == "189"))
        {
            re = true;
        }


        return re;
    }
    #endregion


    #region 区域改变事件
    protected void ddl_ParentArea_SelectedIndexChanged(object sender, EventArgs e)
    {
        //绑定医院
        BindDropDownListByAreaInfo(ddlHospital);

        //绑定科室
        BindDropDownListforDep(ddlDep);

        gvitemBind();
    }
    #endregion

    #region 医院选项变动事件
    protected void ddlHospital_SelectedIndexChanged(object sender, EventArgs e)
    {
        //绑定科室
        BindDropDownListforDep(ddlDep);
        gvitemBind();
    }
    #endregion
}
